import random

l = []
ll = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
for i in range(10):
    d = {"sid": 101+i, "name": ll[i], "age": random.randint(7, 8)}
    l.append(d)

for i in range(len(l)-1):
    max_index = i
    for j in range(i+1, len(l)):
        if l[max_index]["age"] > l[j]["age"]:
            max_index = j
    if max_index != i:
        age = l[max_index]
        l[max_index] = l[i]
        l[i] = age

for i in range(len(l)-1):
    for j in range(i+1, len(l)):
        if l[i]["age"] == l[j]["age"] and l[i]["sid"] < l[j]["sid"]:
            sid = l[j]["sid"]
            l[j]["sid"] = l[i]["sid"]
            l[i]["sid"] = sid

for s in l:
    print(s)
